package org.foreveross.hbase.client;


import java.io.IOException;

import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTableInterface;

public class HbaseDriverManager {
	/**
	 * 获取HBaseAdmin
	 * 
	 * @return
	 */
	public static HBaseAdmin getHBaseAdmin() {
		return com.fare.taluo.db.hbase.HbaseDriverManager.getInstance().getHBaseAdmin();
	}

	/**
	 * 返回htablepool连接池中的一个htable
	 * 
	 * @param tableName
	 * @return
	 */
	public static synchronized HTableInterface getHtable(String tableName) {
		try {
			return com.fare.taluo.db.hbase.HbaseDriverManager.getInstance().getHtable(tableName);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}


	public static void releaseHtable(HTableInterface t) {
		com.fare.taluo.db.hbase.HbaseDriverManager.getInstance().releaseHTable(t);
	}
	

}
